package com.xinqing.test.LetCode;

/**
 * @Author:CHQ
 * @Date:2021/7/21 9:57
 * @Description
 */
public class IsSubsequence {
    public static void main(String[] args) {

        String t="abc";
        String s="ahbgdc";

        System.out.println(test(t,s));


    }
    public static boolean test(String t,String s){
        int index=-1;
        for(char c:t.toCharArray()){
            index=s.indexOf(c,index+1);
            if(index==-1){
                return false;
            }
        }
        return true;
    }
}
